package housing.task2.stale.fileIO;

import housing.task1.actor.Renter;
import housing.task2.i18n.ConsoleMenu;
import housing.task2.stale.fileIO.jsn.GenericWriter;
import housing.task2.stale.fileIO.jsn.Reader;

import java.util.ArrayList;


/**
 * Created by IntelliJ IDEA.
 * User: Linderhof
 * Date: 10.11.2010
 * Time: 10:09:17
 */
public class Main2 {
    /**
     * Writes localized greetings
     *
     * @param args
     */
    public static void main(String[] args) {
        String dir = ".\\src\\main\\resources\\jsn\\";
        String rentersFile = new String(dir + "Renter.jsn");

        ConsoleMenu.execute();

        try {
            for (int i = 0; i < 10; i++) {
                GenericWriter.write(new Renter(), rentersFile);
            }

            //Reading
            ArrayList<Renter> renters = Reader.readRenter(rentersFile);

            for (Renter renter : renters) {
                System.out.println(renter);
            }

//
//            // CSV
//            String CSVrentersFile = new String(dir + "rentersCSV.csv");
//            WriterOld.writeRenterIntoFile(first, CSVrentersFile);
//
//            ArrayList<Renter.xsd> Renter = ReaderOld.getRenter(CSVrentersFile);
//            System.out.println(Renter.toString());

        } catch (Exception e/* IOException e */) {
            e.printStackTrace();
        }

    }         // void main()
}// class Main1
